Skip to content

Conversation

0xrusowsky
Copy link
Contributor

@0xrusowsky 0xrusowsky commented Sep 11, 2025

Motivation

Historically, vm.parseJson has had a limitation where fields had to be sorted in alphabetical order. However, now that we are integrating solar everywhere, there is an opportunity to leverage it to deterministically figure out the struct fields and their order, and overcome this limitation.

Solution

Introduce a new field struct_defs to the struct Cheatcodes, which gives it access to a hashmap that stores all struct definitions and their (sorted) fields (with their type):

pub struct StructDefinitions(Arc<HashMap<String, Vec<(String, String)>>>);

old disc:

@0xrusowsky 0xrusowsky changed the title feat(cheats): sorted JSON params feat(cheats): preserve struct order when parsing JSON objects Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant